1bashThis demonstrates using the =~ operator in Bash to test a string against a regex pattern for email validation.email=me@example.com if [[ "$email" =~ [a-z]+@[a-z]{2,}\.(com|net|org) ]] then echo "Valid email!" fibash internalflow controltests (conditions)regex condition
2bashThis demonstrates basic regex matching in Bash using the =~ operator.# Regex [[ "A" =~ . ]]bash internalflow controltests (conditions)regex condition